package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

//归还书籍
public class ReturnOperation implements IOperation{
    @Override
    public void word(BookList bookList) {
        System.out.println("归还书籍");
        Scanner scanner = new Scanner(System.in);
        System.out.println("你要归还的书籍的名称:>");
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.getUsedSize(); i++) {
            if(name.equals(bookList.getBook(i).getName())){
                    bookList.getBook(i).setBorrowed(false);
                return;
            }
        }

    }
}
